package Comprehensive_02;

public class Test7 {
    public static void main(String[] args) {
        int sum = getSum(20);
        int jc = getJc(5);
        System.out.println("jc = " + jc);
        System.out.println("sum = " + sum);
    }


    private static int getJc(int number) {
        if (number == 1) return 1;
        return number * getJc(number - 1);
    }

    private static int getSum(int number) {
        if (number == 1) return 1;
        return number + getSum(number - 1);
    }

}
